Split the configuration file parsing and xc dominfo parsing aspects of
authoremellor@ewan <emellor@ewan>
Wed, 21 Sep 2005 14:23:26 +0000 (15:23 +0100)
committeremellor@ewan <emellor@ewan>
Wed, 21 Sep 2005 14:23:26 +0000 (15:23 +0100)
commitf28ff9d5c08745c9618e241d62179a11c1acb4d6
tree554d7c38bab109674c07cf0e368eb5b2630fb462
parentd02cb884e0f55d0727adc155ec70234a3d10c3ee
Split the configuration file parsing and xc dominfo parsing aspects of
XendDomainInfo out from the rest of the code, creating an intermediate
dictionary of common format.  This means that the rest of XendDomainInfo can
work whether creating a domain for the first time, or whether xend is
restarted but the domains still exist.  This means that xend is now robust in
the face of restarts.  The phase of validation of configuration details is
now more explicit, and stronger too.

Change the handling of memory sizes in XendDomainInfo's interface to use KiB
in setMemoryTarget and getMemoryTarget.  This gives reasonable granularity
whilst ensuring that we can handle values up to 2TiB without overflowing a
signed 32 bit value.  It is not clear that the xend code, especially the C /
Python interface, is either 64-bit clean or unsigned 32-bit clean, so this is
the safest choice for now.  The behaviour of Python's shift operator will
change in Python 2.4, so it is best to address this problem once we have moved
to that version.

Determine the backend flags on-the-fly, in getBackendFlags, rather than
computing them in advance in configureBackends and storing the value.  Change
addControllerClass so that backend flag information is in this table too,
rather than hard-coded elsewhere.

Improve the error reporting for name clashes.

Remove XendDomainInfo's dependence upon DBMap, and use xstransact directly
instead.  This changes the interface from XendDomain to XendDomainInfo, as
paths rather than DBMaps are passed in.

Remove the XendDomainInfo.recreate and restore flags.  Since the device and
domain handling is now stateless inside xend, much less work is necessary for
recreate and restore procedures, so we can do without these flags.

Remove XendDomainInfo's unused dependency upon SrvDaemon, and its unnecessary
dependence upon PrettyPrint.  Remove the unused show method.

Decouple image.py from XendDomainInfo.bootloader by passing a bootloading flag
into initDomain instead.  Decouple it from XendDomainInfo.config by passing
the semiparsed device configuration into create().  Move configuration in
VmxImageHandler so that rather than being scattered around the class it is in
or called from the configure method.  Device configuration is no longer
available anywhere else.

From Dan Smith <danms@us.ibm.com>:

      I could not find in the existing code the point at which
      a domain was added to the XendDomain list after restore.  Several
      attempts to restore would result in positive log messages, but the
      restored domain would not show up in "xm list".  This patch includes a
      call to _add_domain(), which results in restore working for me.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/image.py